#include<stdio.h>

#define MIN(x, y) (x < y ? x : y)

int distributeCandies(int* candyType, int candyTypeSize)
{
    int p = 0;
    char flag = 1;
    for (int i = 1; i < candyTypeSize; ++i)
    {
        for (int j = 0; j <= p; ++j)
        {
            if (candyType[i] == candyType[j])
            {
                flag = 0;
                break;
            }
        }
        if (flag)
        {
            ++p;
            candyType[p] = candyType[i];
        }
        flag = 1;
    }
    return MIN(p + 1, candyTypeSize / 2);
}

int main()
{
    int* arr[] = {1, 2, 3, 4, 5, 4};
    int ret = distributeCandies(arr, 6);
    printf("%d", ret);

    return 0;
}
